package com.sunyard.dal.mapper;

import com.sunyard.dal.dto.TerminalCopyDTO;
import com.sunyard.dal.entity.TerminalCopy;
import com.sunyard.dal.entity.TerminalCopyExport;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TerminalCopyMapper {
    /**
     * delete by primary key
     *
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(TerminalCopy record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(TerminalCopy record);

    /**
     * select by primary key
     *
     * @param id primary key
     * @return object by primary key
     */
    TerminalCopy selectByPrimaryKey(Integer id);

    /**
     * select by mac
     *
     * @param mac
     * @return object by mac
     */
    int selectByMac(String mac,Integer auditType,Integer type);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(TerminalCopy record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(TerminalCopy record);

    List<TerminalCopy> queryCopyList(TerminalCopyDTO record);

    List<TerminalCopyExport> terminalAuditExport(TerminalCopyDTO record);

    /**
     * 通过终端id查询审核信息
     *
     * @param id [id]
     * @return TerminalCopy
     **/
    List<TerminalCopy> selectByTerminalId(Integer terminalId);

    Integer selectCount(String orgId);

    //获取首页待审核设备数量
    int getTerminalCount(@Param("orgIds") List<String> orgIds);

    List<TerminalCopy> selectByAuditByTerId(@Param("id") Integer id, @Param("terminalId")  Integer terminalId);

    void updateById(TerminalCopy terminalCopy);

    void deleteByTerId(String terId);

    void deleteByMac(String mac);

    int deleteByAdminId(String adminId);

    //未上传日志钥匙数量
    int getNotSignInCount(@Param("orgIds") List<String> orgIds);

    int getLockAuditCount(@Param("orgIds") List<String> orgIds);

    int getTailBoxCount(@Param("orgIds") List<String> orgIds);

    int getKeyAuditCount(@Param("orgIds") List<String> orgIds);

    int getPdaAuditCount(@Param("orgIds") List<String> orgIds);

    int getRfidAuditCount(@Param("orgIds") List<String> orgIds);

    TerminalCopy getCopyByName(String name);

    List<TerminalCopy> selectByTerminalMac(String mac);
}